﻿#pragma once
#include "GLLObj.h"

namespace GLL
{
	class Level;

	/**摄像机是隶属于Virtual World的物体.*/
	class ObjectCamera : public Object
	{
		friend class ObjectManager;
		friend class VirtualWorld;
		int _index;
		Position3Df _pos;
		Position3Df _look;
		float _l, _t, _w, _h;
		int _z;
		ObjRefPtr _target;
#ifdef GLL_OGRE
		Ogre::Camera* _cam;
		Ogre::Viewport* _canvas;
#endif GLL_OGRE
		virtual void _DoLoad(){}
		virtual void _DoUnload(){}
		ObjectCamera();

	public:
		virtual void SetRotation(const Axis3Df&){}
		virtual Axis3Df GetRotation();

		virtual Position3Df GetPosition();
		virtual void SetPosition(const Position3Df&);
		void SetLookAt(const Position3Df&);
		void SetCanvas(float left, float top, float width, float height);
		void AdjustAspectRatio();
		void _Add2Level(Level*);
		void _RemoveFromLevel(Level*);
		int GetIndex(){return _index;}
	};

	typedef boost::shared_ptr<ObjectCamera> CamSrdPtr;

};//GLL
